<template>
	<div>
		<table border="1">
			<tr>
				<th>编号</th>
				<th>图书名称</th>
				<th>作者</th>
			</tr>
			<tr v-for="item in bookList" :key="item.id">
				<td>{{item.id}}</td>
				<td>{{item.name}}</td>
				<td>{{item.author}}</td>
			</tr>
		</table>
	</div>
</template>

<script>
	export default{
		name:'About',
		data(){
			return {
				id:'',
				name:'',
				author:'',
				bookList:[
					{id:1,name:'java基础',author:'李四'},
					{id:2,name:'springboot基础',author:'张三'},
					{id:3,name:'vue基础',author:'王五'},
				]
			}
		},
		created() {
			this.getBookList()
		},
		methods:{
			getBookList(){  //获取图书列表
				axios.get('http://localhost:8888/book/findAll').then(result => {
					console.log(result)
					this.bookList=result.data
				})
			}
		}
	}
</script>

<style>
</style>
